<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>弹性空间</title>
		<style>
			#box{
				height: 300px;
				border: 1px solid #000;
				/*新版弹性盒模型
				display: flex;*/
				
				/*老版的弹性盒模型*/
				display: -webkit-box;
				
				
			}
			#box div{
				width: 50px;
				height: 50px;
				background: purple;
				font-size: 30px;
				color: #fff;
				
				/*新版弹性盒模型
				flex-grow: 1;*/
				
				
				/*老版弹性盒模型*/
				-webkit-box-flex: 1;
			}
			/*子元素的尺寸 = 盒子的尺寸*子元素的box-flex的属性值/所有子元素的box-flex属性值的和*/
			#box div:nth-of-type(2){
				/*line-height: 50px;*/
				width: 100px;
				
			}
		</style>
	</head>
	<body>
		<div id="box">
			<div>1</div>
			<div>2</div>
			<div>3</div>
			<div>4</div>
		</div>
	</body>
</html>
